package com.xbongbong.paas.pojo.workflow.settings;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;

/**
 * @author 吴峰
 * @date 2021/09/09 15:51
 */
@Getter
@Setter
@ToString
public class WorkflowPojo implements Serializable {

    /**
     * 主键
     */
    private Long id;

    /**
     * 公司id
     */
    private String corpid;

    /**
     * 图标
     */
    private String icon;

    /**
     * 工作流名称
     */
    private String name;

    /**
     * 触发类型:1 表单事件触发，2 时间触发，3 时间字段触发 4 webhook触发 5 员工事件触发 6 自定义触发方式
     * @see WorkflowTriggerMethodEnum
     */
    private Integer type;

    /**
     * 详细触发事件类型
     */
    private Integer triggerEventType;

    /**
     * 详细触发事件类型描述
     */
    private String triggerEventInfo;

    /**
     * 触发表单应用id
     */
    private Long appId;

    /**
     * 表单名称
     */
    private String formName;

    /**
     * 触发表单id
     */
    private Long formId;

    /**
     * 触发表单menu_id
     */
    private Long menuId;

    /**
     * 1 为saas，2为paas
     */
    private Integer saasMark;

    /**
     * saas模块标识
     */
    private Integer businessType;


    /**
     * 优先级字段；表单的工作流将根据这个由小到大进行运转
     */
    private Integer priority;

    /**
     * 工作流是否启用，1启用，0未启用
     */
    private Integer enable;

    /**
     * 是否包含审批节点
     */
    private Integer isApprove;

    /**
     * 最近启用时间
     */
    private Long lastEnableTime;

    /**
     * 审批结束后是否允许编辑，选择允许，提交人可以再次编辑审批后内容；选择不允许，提交人不可以再次编辑审批后内容，数据权限是全公司的人除外
     */
    private Integer allowEditAfterFinished;

    /**
     * 是否允许撤回，1允许，0不允许
     */
    private Integer allowWithdraw;

    /**
     * 是否允许查看日志，1允许，0不允许
     */
    private Integer allowViewLog;

    /**
     * 是否允许查看全流程，1允许，0不允许
     */
    private Integer allowViewWhole;

    /**
     * 审批人为空处理类型：1超管转交处理，2自动通过，3自动拒绝
     */
    private Integer emptyApproverType;

    /**
     * 流程版本名称
     */
    private String versionName;
    /**
     * 版本
     */
    private String version;
    /**
     * 流程版本id
     */
    private Integer versionId;

    /**
     * 1：当前使用版本 0: 其他版本
     */
    private Integer currentVersion;

    /**
     * 是否使用开始节点数据权限
     */
    private Integer usePermission;

    /**
     * 审批人去重，1：同一个审批人在流程中出现多次时，仅保留第一个；2：同一个审批人仅在连续出现时，自动去重 ;3:不启用自动去重  默认为3
     */
    private Integer approverDedup;

    /**
     * 发起人是审批人时是否通过，0：否；1：是
     */
    private Integer autoApprovedPass;

    /**
     * 1,归档,2未归档
     */
    private Integer isArchive;

    /**
     * 创建者id
     */
    private String creatorId;

    /**
     * 创建时间时间戳
     */
    private Long addTime;

    /**
     * 更新时间时间戳
     */
    private Long updateTime;

    /**
     * 删除标记
     */
    private Integer del;

    /**
     * 无需审批
     */
    private String rolesWithoutApprove;

    public WorkflowPojo(Long id, String corpid, String icon, String name, Integer type, Integer triggerEventType, Long appId, Long formId, Long menuId, Integer saasMark, Integer businessType, Integer priority, Integer enable, Integer isApprove, Long lastEnableTime, Integer allowEditAfterFinished, Integer allowWithdraw, Integer allowViewLog, Integer allowViewWhole, Integer emptyApproverType, String versionName, String version, Integer versionId, Integer currentVersion, Integer usePermission, Integer approverDedup, Integer autoApprovedPass, Integer isArchive, String rolesWithoutApprove) {
        this.id = id;
        this.corpid = corpid;
        this.icon = icon;
        this.name = name;
        this.type = type;
        this.triggerEventType = triggerEventType;
        this.appId = appId;
        this.formId = formId;
        this.menuId = menuId;
        this.saasMark = saasMark;
        this.businessType = businessType;
        this.priority = priority;
        this.enable = enable;
        this.isApprove = isApprove;
        this.lastEnableTime = lastEnableTime;
        this.allowEditAfterFinished = allowEditAfterFinished;
        this.allowWithdraw = allowWithdraw;
        this.allowViewLog = allowViewLog;
        this.allowViewWhole = allowViewWhole;
        this.emptyApproverType = emptyApproverType;
        this.versionName = versionName;
        this.version = version;
        this.versionId = versionId;
        this.currentVersion = currentVersion;
        this.usePermission = usePermission;
        this.approverDedup = approverDedup;
        this.autoApprovedPass = autoApprovedPass;
        this.isArchive = isArchive;
        this.rolesWithoutApprove = rolesWithoutApprove;
    }
}
